keytool -genkey -dname "cn=tuwien, ou=tuwien, o=tuwien, c=tuwien" -alias ExternalService -keypass 123456 -keystore external-service.jks -storepass 123456 -validity 360 -keyalg "RSA"
keytool -genkey -dname "cn=tuwien, ou=tuwien, o=tuwien, c=tuwien" -alias IndexGateway -keypass 123456 -keystore index-gateway.jks -storepass 123456 -validity 360 -keyalg "RSA"
keytool -genkey -dname "cn=tuwien, ou=tuwien, o=tuwien, c=tuwien" -alias LocationGateway1 -keypass 123456 -keystore location1-gateway.jks -storepass 123456 -validity 360 -keyalg "RSA"
keytool -genkey -dname "cn=tuwien, ou=tuwien, o=tuwien, c=tuwien" -alias LocationGateway2 -keypass 123456 -keystore location2-gateway.jks -storepass 123456 -validity 360 -keyalg "RSA"

keytool -export -alias ExternalService -file external-service.crt -keystore external-service.jks -storepass 123456
keytool -export -alias IndexGateway -file index-gateway.crt -keystore index-gateway.jks -storepass 123456
keytool -export -alias LocationGateway1 -file location1-gateway.crt -keystore location1-gateway.jks -storepass 123456
keytool -export -alias LocationGateway2 -file location2-gateway.crt -keystore location2-gateway.jks -storepass 123456

keytool -import -alias ExternalService -file external-service.crt -keystore index-gateway.jks -storepass 123456
keytool -import -alias ExternalService -file external-service.crt -keystore location1-gateway.jks -storepass 123456
keytool -import -alias ExternalService -file external-service.crt -keystore location2-gateway.jks -storepass 123456

keytool -import -alias IndexGateway -file index-gateway.crt -keystore external-service.jks -storepass 123456
keytool -import -alias IndexGateway -file index-gateway.crt -keystore location1-gateway.jks -storepass 123456
keytool -import -alias IndexGateway -file index-gateway.crt -keystore location2-gateway.jks -storepass 123456

keytool -import -alias LocationGateway1 -file location1-gateway.crt -keystore index-gateway.jks -storepass 123456
keytool -import -alias LocationGateway1 -file location1-gateway.crt -keystore external-service.jks -storepass 123456
keytool -import -alias LocationGateway1 -file location1-gateway.crt -keystore location2-gateway.jks -storepass 123456

keytool -import -alias LocationGateway2 -file location2-gateway.crt -keystore index-gateway.jks -storepass 123456
keytool -import -alias LocationGateway2 -file location2-gateway.crt -keystore location1-gateway.jks -storepass 123456
keytool -import -alias LocationGateway2 -file location2-gateway.crt -keystore  external-service.jks -storepass 123456